﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Eassets.Layered.Domain.Global;
using Eassets.Data.Global;
using System.Collections.ObjectModel;

namespace Eassets.Service.Global
{
    public class AuthorizationGroupMemberService
    {
        AuthorizationGroupMemberData authorizationGroupMemberdata = new AuthorizationGroupMemberData();

        /// <summary>
        /// Inserts authorizationGroupMember.
        /// </summary>
        /// <param name="authorizationGroupMember"></param>
        public void AddAuthorizationGroupMember(AuthorizationGroupMember authorizationGroupMember)
        {
            if (authorizationGroupMember != null)
            {
                authorizationGroupMemberdata.AddAuthorizationGroupMember(authorizationGroupMember);
            }
        }

        /// <summary>
        /// Updates authorizationGroupMember.
        /// </summary>
        /// <param name="authorizationGroupMember"></param>
        public void ModifyAuthorizationGroupMember(AuthorizationGroupMember authorizationGroupMember)
        {
            if (authorizationGroupMember != null)
            {
                authorizationGroupMemberdata.ModifyAuthorizationGroupMember(authorizationGroupMember);
            }
        }

        /// <summary>
        /// Delete authorizationGroupMember.
        /// </summary>
        /// <param name="authorizationGroupMemberId"></param>
        public void DeleteAuthorizationGroupMember(long authorizationGroupMemberId)
        {
            if (authorizationGroupMemberId != 0)
            {
                authorizationGroupMemberdata.DeleteAuthorizationGroupMember(authorizationGroupMemberId);
            }
        }

        /// <summary>
        /// GetbyId authorizationGroupMember.
        /// </summary>
        /// <param name="authorizationGroupMemberId"></param>
        /// <returns></returns>
        public AuthorizationGroupMember GetByIdAuthorizationGroupMember(long authorizationGroupMemberId)
        {
            return authorizationGroupMemberdata.GetByIdAuthorizationGroupMember(authorizationGroupMemberId);
        }

        /// <summary>
        /// GetAll authorizationGroupMember.
        /// </summary>
        /// <returns></returns>
        public Collection<AuthorizationGroupMember> GetAllAuthorizationGroupMember()
        {
            return authorizationGroupMemberdata.GetAllAuthorizationGroupMember();
        }

        public void MapAuthorizationGroupMember(List<AuthorizationGroupMember> authorizationGroupMembers)
        {
            authorizationGroupMemberdata.Map(authorizationGroupMembers);
        }

        public Collection<AuthorizationGroupMember> GetmappedEmployeeDetailsDetailsByAuthorizationGropId(long authorizationGropId)
        {
            return authorizationGroupMemberdata.GetmappedEmployeeDetailsByAuthorizationGroupId(authorizationGropId);
        }

        public Collection<AuthorizationGroupMember> GetAllUnmappedEmployeeDetailsDetailsByAuthorizationGropId(long authorizationGropId)
        {
            return authorizationGroupMemberdata.GetAllUnmappedEmployeeDetailsByAuthorizationGroupId(authorizationGropId);
        }

        public Collection<long> GetEmpIdFromAuthorizationGroupMember(long authorizationGroupId)
        {
            return authorizationGroupMemberdata.GetEmpIdFromAuthorizationGroupMember(authorizationGroupId);
        }

        //public Collection<long> GetEmpIdFromEmployeeMappedByAuthorizationGroupMember()
        //{
        //    return authorizationGroupMemberdata.GetEmpIdFromEmployeeMappedByAuthorizationGroupMember();
        //}

        public Collection<long> GetUnMappedEmpIdsByAuthorizationGroup(long authorizationGroupId)
        {
            return authorizationGroupMemberdata.GetUnMappedEmpIdsByAuthorizationGroup(authorizationGroupId);
        }

        public long GetAuthorizationGroupMemberIdFromAuthorizationGroupMember(long employeeId, long authorizationGroupId)
        {
            return authorizationGroupMemberdata.GetAuthorizationGroupMemberIdFromAuthorizationGroupMember(employeeId,
                                                                                                   authorizationGroupId);
        }
    }
}
